export class EmptyUtil {
	static isEmptyString(data) {
		return typeof data === 'undefined' || data == null || data === ''
	}

	static isNotEmptyString(data) {
		return !this.isEmptyString(data)
	}

	static isEmptyObject(data) {
		return data === null || undefined === data || Object.keys(data).length === 0
	}

	static isNotEmptyObject(data) {
		return !this.isEmptyObject(data)
	}

	static isEmptyArray(data) {
		if (data === null || undefined === data) {
			return true
		}
		return data.length === 0
	}

	static isNotEmptyArray(data: any) {
		return !this.isEmptyArray(data)
	}

	static filterObjEmpty = data => {
		for (const key in data) {
			if (data[key] == null || data[key] === undefined || data[key] === ' ' || data[key] === '') {
				delete data[key]
			}
		}
		return data
	}
}
